const Comments: React.FC = () => {
  const [comments, setComments] = useState<CommentType[]>([]);
  const currentUser = JSON.parse(localStorage.getItem('user') || '{}');

  useEffect(() => {
    // 获取评论时检查用户身份
    fetchComments().then(data => {
      // 只显示当前用户的评论
      const userComments = data.filter(comment => 
        comment.user.email === currentUser.email
      );
      setComments(userComments);
    });
  }, [currentUser.email]);

  // ... 其他代码
};